<template>
	<view class="box">
		<view class="title">{{$t("服务内容")}}</view>
		<view class="titleContent">
			{{item[$t('item.product')]}}
		</view>
		<view class="lineP cloum">
			<view>{{$t("服务报价")}}:</view>
			<view class="price">{{item.price}}<text>{{$t(item.price_unit)}}</text></view>
		</view>
		<view class="lineP cloum">
			<view>{{$t("服务时长")}}:</view>
			<view>{{item.speed}}<text>{{$t(item.speed_unit)}}</text></view>
		</view>
		<view class="lineP cloum"  v-if="item.pay_margin!=0">
			<view>{{$t("是否缴纳保证金")}}:</view>
			<view>{{item.pay_margin == '0' ? $t("否") : $t("是")}}</view>
		</view>
		<view class="lineP cloum"  v-if="item.pay_margin!=0">
			<view>{{$t("保证金金额")}}:</view>
			<view class="price">{{item.margin_amount}}<text class="black">{{$t("元")}}</text></view>
		</view>
		<u-image class="produceImg" v-if="item&&item.images&&item.images.length!=0" :src="toImages(item.images[0]) || HTTP_IMG_UTL+'ma.jpg'" width="250rpx"
			height="250rpx" border-radius="20rpx"></u-image>
	</view>
</template>

<script>
	import {
		IMAGE_URL,
		HTTP_IMG_UTL
	} from '@/config/app'
	import {
		ImageUrl,
		isBase64
	} from "@/common/public";
	export default {
		props: {
			item: {
				type: Object,
				default: {},
			},
			type: {
				type: String | Number,
				default: '1',
			},
		},
		data() {
			return {
				HTTP_IMG_UTL
			}
		},
		computed: {
			toImages() {
				return (src) => {
					return isBase64(src) ? src : IMAGE_URL + src
				}
			},
		}
	}
</script>

<style lang="scss" scoped>
	.box {
		width: 90%;
		box-shadow: 0 0 10px #ddd;
		border-radius: 10px;
		padding: 10px 12px;
		margin: 0 auto;
		margin-bottom: 20rpx;
		font-size: 30rpx;
		position: relative;
		color: #262626;

		.lineP {
			display: flex;
			margin-top: 30rpx;

			&.cloum {
				flex-direction: column;
				align-items: flex-start;
				margin-top: 20rpx;
			}

			&>view {
				margin-right: 20rpx;
			}

			.price {
				color: #ff1010;
				font-size: 34rpx;

				text {
					margin-left: 8rpx;
					font-size: 24rpx;
				}

				.black {
					color: #262626;
				}
			}
		}

		.title {
			font-weight: 600;
			font-size: 35rpx;
			line-height: 70rpx;
		}

		.titleContent {
			color: #666666;
			letter-spacing: 4rpx;
			line-height: 45rpx;
		}

		.produceImg {
			position: absolute;
			bottom: 20rpx;
			right: 20rpx;
		}
	}
</style>